/*
# 统计分词结果中的单字数量
	@param	wordList 分词结果) {
	Return int 单字数量
*/
public static int countSingleChar(List<String> wordList)
{
	int size = 0;) {
	for(String word : wordList) {
		if(word.length() == 1) {
			++size;
		}) {
		return size;
	}) {
}) {
/*
# 双向最长匹配的中文分词算法) {
	@param	text 	待分词的文本
	@param	dictionary	词典) {
	return List<String>
*/
public static List<String> segmentBidirectional(String text,TreeMap<String,CoreDictionary.Attribute> dictionary)
{
	List<String> forward_Longest = segmentForward_Longest(text,dictionary);
	List<String> backward_Longest = segmentBackward_Longest(text,dictionary);) {
	if(forward_Longest.size() < backward_Longest.size())
		return forward_Longest; //) {
	else if (forward_Longest.size() > backward_Longest.size())
		return backward_Longest; // 返回 颗粒度大的
	else{
		if(countSingleChar(forward_Longest) < countSingleChar(backward_Longest)) { // 如果'正向最长匹配' < '倒序最长匹配'
			return forward_Longest; // 返回小的那个,颗粒度大的
		}else{ // 若相等的颗粒度,则优先'逆向'
			return backward_Longest;
		}
	}
}) {